<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/6/9
  Time: 10:15
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
    <title>销售机会详情</title>
    <%--引入css文件--%>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layui/css/layui.css">
</head>
<body>
<form class="layui-form">
    <input type="hidden" name="id" value="${saleOpportunity.id}">

    <div class="layui-form-item">
        <label class="layui-form-label">客户:</label>
        <div class="layui-input-inline">
            <%--<select name="customer_Id" lay-verify="required">
                <option value="">请选择</option>
                <option value="101" <c:if test="${saleOpportunity.customer_Id=='101'}">selected</c:if> >客户1</option>
                <option value="102" <c:if test="${saleOpportunity.customer_Id=='102'}">selected</c:if> >客户2</option>
                <option value="103" <c:if test="${saleOpportunity.customer_Id=='103'}">selected</c:if> >客户3</option>
            </select>--%>
            <select name="customer_Id" lay-verify="required">
                <option value="">请选择</option>
                <c:forEach items="${sessionScope.customers}" var="customer">
                    <option value="${customer.id}" <c:if test="${saleOpportunity.customer_Id == customer.id}">selected</c:if> > ${customer.name}</option>
                </c:forEach>
            </select>
        </div>
        <label class="layui-form-label">机会来源:</label>
        <div class="layui-input-inline">
            <select name="source"  lay-verify="required">
                <option value="">请选择</option>
                <option value="客户介绍" <c:if test="${saleOpportunity.source=='客户介绍'}">selected</c:if> >客户介绍</option>
                <option value="招标广告" <c:if test="${saleOpportunity.source=='招标广告'}">selected</c:if> >招标广告</option>
                <option value="广告宣传" <c:if test="${saleOpportunity.source=='广告宣传'}">selected</c:if> >广告宣传</option>
            </select>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">成功率:</label>
        <div class="layui-input-inline">
            <select name="success"  lay-verify="required">
                <option value="">请选择</option>
                <option value="50%" <c:if test="${saleOpportunity.success=='50%'}">selected</c:if> >50%</option>
                <option value="60%" <c:if test="${saleOpportunity.success=='60%'}">selected</c:if> >60%</option>
                <option value="70%" <c:if test="${saleOpportunity.success=='70%'}">selected</c:if> >70%</option>
                <option value="80%" <c:if test="${saleOpportunity.success=='80%'}">selected</c:if> >80%</option>
                <option value="90%" <c:if test="${saleOpportunity.success=='90%'}">selected</c:if> >90%</option>
            </select>
        </div>
        <label class="layui-form-label">客户联系人:</label>
        <div class="layui-input-inline">
            <select name="contact_Id" lay-verify="required">
                <option value="">请选择</option>
                <option value="201" <c:if test="${saleOpportunity.contact_Id=='201'}">selected</c:if> >联系人1</option>
                <option value="202" <c:if test="${saleOpportunity.contact_Id=='202'}">selected</c:if> >联系人2</option>
                <option value="203" <c:if test="${saleOpportunity.contact_Id=='203'}">selected</c:if> >联系人3</option>
            </select>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">机会状态:</label>
        <div class="layui-input-inline">
            <select name="status" lay-verify="required">
                <option value="">请选择</option>
                <option value="立项评估" <c:if test="${saleOpportunity.status=='立项评估'}">selected</c:if> >立项评估</option>
                <option value="商务谈判" <c:if test="${saleOpportunity.status=='商务谈判'}">selected</c:if> >商务谈判</option>
                <option value="解决方案" <c:if test="${saleOpportunity.status=='解决方案'}">selected</c:if> >解决方案</option>
                <option value="初期沟通" <c:if test="${saleOpportunity.status=='初期沟通'}">selected</c:if> >初期沟通</option>
                <option value="已报价" <c:if test="${saleOpportunity.status=='已报价'}">selected</c:if> >已报价</option>
                <option value="合同/订单签订" <c:if test="${saleOpportunity.status=='合同/订单签订'}">selected</c:if> >合同/订单签订</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">机会概要:</label>
        <div class="layui-input-inline">
            <textarea name="general" placeholder="请输入内容" class="layui-textarea">${saleOpportunity.general}</textarea>
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">机会描述</label>
        <div class="layui-input-inline">
            <textarea id="description" name="description">${saleOpportunity.description}</textarea>
        </div>
    </div>

</form>
<%--引入js文件--%>
<script src="${pageContext.request.contextPath}/static/layui/layui.js"></script>
<script>
    //layui引入特定模块
    layui.use(['layedit','layer','form',"jquery"],function () {
        var layedit = layui.layedit;
        var layer=layui.layer;//layer弹窗对象
        var form= layui.form;//form表单对象
        var $=layui.$;//jquery对象
        var index =layedit.build('description'); //建立编辑器

        //设置编辑器属性
        layedit.set({
            uploadImage: {//图片上传的接口
                url: '${pageContext.request.contextPath}/sale/uploadImg' //接口url
                ,type: 'post' //默认post
            },
            height:200
        });
    });
</script>
</body>
</html>
